{% extends 'myadmin/base.html' %}
{% block myadmin_user_active %}
    active
{% endblock %}
{% block myadmin %}
    <h3 style="margin-top: 15px;" class="offset-1">&emsp;&emsp;编辑用户</h3>

    <div class="col-md-6 offset-1">
        <hr>
        <form action="" method="post">
            {% csrf_token %}
            <div class="row mb-3">
                <label for="inputEmail3" class="col-sm-2 col-form-label">用户名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmail3" readonly value="{{ user.name }}">
                </div>
            </div>
            <div class="row mb-3">
                <label for="inputPassword3" class="col-sm-2 col-form-label">邮箱</label>
                <div class="col-sm-10">
                    <input type="email" class="form-control" id="inputPassword3" name="email" value="{{ user.email }}">
                </div>
            </div>
            <div class="row mb-3">
                <label for="inputPassword3" class="col-sm-2 col-form-label">手机号</label>
                <div class="col-sm-10">
                    <input name="phone" type="text" class="form-control" id="inputPassword3" value="{{ user.phone }}">
                </div>
            </div>


            <fieldset class="row mb-3">
                <legend class="col-form-label col-sm-2 pt-0">用户类型</legend>
                <div class="col-sm-10">
                    <div class="form-check">
                        <input class="form-check-input" type="radio" name="type" id="gridRadios1" value="1"
                                {% if user.type == 1 %}
                               checked
                                {% endif %} >
                        <label class="form-check-label" for="gridRadios1">
                            普通用户
                        </label>
                    </div>
                    <div class="form-check">
                        <input class="form-check-input" type="radio" name="type" id="gridRadios2" value="3"
                                {% if user.type == 3 %}
                               checked
                                {% endif %}>
                        <label class="form-check-label" for="gridRadios2">
                            教师
                        </label>
                    </div>
                    <div class="form-check ">
                        <input class="form-check-input" type="radio" name="type" id="gridRadios3" value="6"
                                {% if user.type == 6 %}
                               checked
                                {% endif %}>
                        <label class="form-check-label" for="gridRadios3">
                            管理员
                        </label>
                    </div>
                    <div class="form-check ">
                        <input class="form-check-input" type="radio" name="type" id="gridRadios4" value="9"
                                {% if user.type == 9 %}
                               checked
                                {% endif %}>
                        <label class="form-check-label" for="gridRadios4">
                            禁用
                        </label>
                    </div>

                </div>
            </fieldset>


            <button type="submit" class="btn btn-primary offset-2 w-25">保存</button>
        </form>
    </div>


{% endblock %}

